package com.qingcheng.service.impl;


import com.qingcheng.service.goods.CategoryService;
import com.qingcheng.service.goods.SkuService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.net.URL;
import java.util.ResourceBundle;

/**
 * @ProjectName: qingcheng_parent
 * @ClassName: Init
 * @Time: 2019/7/9
 * @Author: zhou24
 * @Description:
 * @Experience:
 */
@Component
public class Init implements InitializingBean {

    @Autowired
    private CategoryService categoryService;

    @Autowired
    private SkuService skuService;
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("加载缓存Init");
        //加载缓存
        //删除缓存
//        System.out.println("删除缓存");
//        skuService.deleteRedisKeys();
        categoryService.saveCategoryTreeToRedis();
        skuService.saveAllPriceToRedis();
    }
}
